home *** CD-ROM | disk | FTP | other *** search
- Path: stern.fokus.gmd.de!news
- From: Watson <sayegh@fokus.gmd.de>
- Newsgroups: comp.lang.c
- Subject: Re: ugly constants and header files
- Date: Thu, 04 Jan 1996 11:36:03 +0100
- Organization: GMD FOKUS - Research Institute for Open Communication Systems
- Message-ID: <30EBAD93.3AA@fokus.gmd.de>
- References: <1996Jan3.155754.111142@kuhub.cc.ukans.edu>
- NNTP-Posting-Host: pollux.fokus.gmd.de
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b4 (X11; I; SunOS 5.4 sun4m)
-
- anh@kuhub.cc.ukans.edu wrote:
-
- > I have a list of constants, some defined using #define, some are string
- > constants a la char *gSuperStrings[]={"aa","bb"};
- using #define in a header file is ok,
- but do not initialize variables in header files
- like you did it with gSuperStrings[].
-
- > my_const.h --- To be included only once (perferably by the main()
- > module). Definitions
- declare variables directly in your main()-module. I prefer
- to create a separate module vars.c.
-
- > my_ext.h --- To be included by any modules using the constants.
- > Declarations.
- That's perfect :-)
-
- --
- * Greetinx,
- Watson (sayegh@fokus.gmd.de)
- more personal details at:
- http://www.fokus.gmd.de/ovma/employees/sayegh/entry.html
-